import { createRouter, createWebHashHistory } from 'vue-router'
// import HomeView from '../views/HomeView.vue'
import Login from '@/views/Login/Login.vue'
import Layout from '@/views/Layout/Layout.vue'
import Home from '@/views/Home/Home.vue'
import Category from '@/views/Category/Category.vue'
import goods from '@/views/goods/goods.vue'

const routes = [
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    children: [
      {
        path: '',
        name: 'Home',
        component: Home
      },
      {
        path: '/Category/:id',
        name: 'Category',
        component: Category
      },
      {
        path: '/goods/:id',
        name: 'goods',
        component: goods
      },
      {
        path: '/cart',
        name: 'cart',
        component: () => import('@/views/Cart/Cart.vue')
      },
      {
        path: '/settlement',
        name: 'settlement',
        component: () => import('@/views/Settlement/Settlement.vue')
      },
      {
        path: '/pay',
        name: 'pay',
        component: () => import('@/views/Pay/Pay.vue')
      }
    ]
  },
  {
    path: '/Login',
    name: 'Login',
    component: Login
  }

]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
